<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/grid.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/listTable.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/global.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var currentFeeBankId = null;
	function openAdd(){
		var url = "${ctx}/charge_feeBankAction.do?method=initFeeBankAdd";
		top.windowOpen(url,"feeBankAdd","${key.add_feeBank}",350,450,true,"feeBankOptFrameid");
	}

	function openEdit(){
		if(!checkId(true)) return;
		var checkUrl = "${ctx}/charge_feeBankAction.do?method=checkBankIsUsed";
		var parameters = "bankId=" + currentFeeBankId
	 	new Ajax.Request(checkUrl,
            {method: 'post', parameters: parameters, onComplete: function(result){
            	if(result.responseText == "true"){ //被引用了
					Alert("${key.bank_is_by_reference}");
            	}else{
			 		var url = "${ctx}/charge_feeBankAction.do?method=initFeeBankEdit&bankId=" + currentFeeBankId;
					top.windowOpen(url,"feeBankAdd","${key.edit_feeBank}",300,450,true,"feeBankOptFrameid");
					currentFeeBankId = "";
            	}
            }}
            );
	}

	function openDelete(){
		if(!checkId()) return;
		AskConfirm("${key.tipsByDeleteConfirm}","main","deleteBank");
	}
	/**
	* 执行删除动作
	*/
	function deleteBank(){
		var url = "${ctx}/charge_feeBankAction.do?method=deleteFeeBank";
		var parm = "bankID=" + currentFeeBankId;
		new Ajax.Request(url,
		                  {method: 'post', parameters: parm, onComplete: function(result){
		                  					currentFeeBankId = "";
		                  					ajaxSubmitException(result.responseText);
		                  					flustIFrame();
		                  		}}
		                    );
	}
	//检查ID是否为空
	function checkId(isEdit){
		if(currentFeeBankId == null || currentFeeBankId == ""){
			if(isEdit)
				Alert("${key.tipsByModify}");
			else
				Alert("${key.tipsByDelete}");
			return false;
		}
		return true;
	}
	function flustIFrame(){
		document.frames("feeBankListFrameId").location.reload();
	}
</script>
</head>
<body onKeyDown="CommonKey()";oncontextmenu="return HideContextMenu_right()">

<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td id="pageNav_leftimg"><img src="${ctx}/images/ico_fc_yinhang.gif" width="46" height="47"/></td>
      <td id="navWord"><span class="page_title">${key.feeBank_set}</span></td>
      <td class="pageNav_right"><a href="javascript:showFull_in();"><img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/></a></td>
    </tr>
  </table>
</div>
<div class="container">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" id="search01" class="bg_search" >
            <tr>
              <td >
              	<table border="0" cellpadding="0" cellspacing="1">
	                <tr>
					</tr>
              	</table>
              </td>
            </tr>
          </table>
      </td>
    </tr>
    <tr>
      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="65%">&nbsp;</td>
          <td width="35%" align="right">

		  <table border="0" cellpadding="0" cellspacing="0" id="ico2" style="display:show">
            <tr>
            <pms:AuthTag authName="charge_feeBankAction.do?method=initFeeBankAdd">
              	<td class="toolbarico"><a href="#"  onclick="openAdd();" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.add}"/></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_feeBankAction.do?method=initFeeBankEdit">
			    <td class="toolbarico"><a href="#"  onclick="openEdit();" onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="${key.modify}"/></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_feeBankAction.do?method=deleteFeeBank">
			    <td class="toolbarico"><a href="#" onClick="openDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="${key.delete}" width="16" height="16" border="0" align="absbottom"></a></td>
			</pms:AuthTag>
			</tr>
          </table>
		  </td>
        </tr>
      </table></td>
    </tr>

    <tr>
    <td valign="top">
		<iframe id="feeBankListFrameId"  src="${ctx}/charge_feeBankAction.do?method=initFeeBankList" frameborder="0" border="0"  width="100%"></iframe>
	</td>
	</tr>
	</table>

</div>
</body>
</html>
